package com.xindong.paking.controller;

import com.xindong.paking.service.LoginAdminService;
import com.xindong.paking.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "权限管理员登陆模块")
@RestController
@RequestMapping("/loginAdmin")
public class LoginAdminController {
    @Autowired
    private LoginAdminService loginAdminService;

    @ApiOperation("登陆")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "account", value = "用户名",required = true),
            @ApiImplicitParam(name = "password", value = "密码",required = true)
    })
    @GetMapping
    public Result login(@RequestParam("account") String account, @RequestParam("password") String password) {
        return loginAdminService.login(account, password);
    }
}
